home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: IconUpdate.dopus5 1.0 (23.6.97) © by Maik "BLiZZeR" Schreiber [FREEWARE]
-
- Contact: BLiZZeR@dame.de
- http://home.pages.de/~bZ
- */
-
-
-
- /* This is the path to the "IconUpdate" program that comes along with
- ** the MagicWB package. You can specify options after the path.
- */
- IconUpdateProgram = "IconUpdate TCSDW"
-
-
- /* Replace the word "TRUE" with anything else but "TRUE"
- ** (maybe "FALSE" ;) if you don't want to check for ImageDrawers
- ** (although you should think twice before deactivating this).
- */
- CheckForImageDrawers = TRUE
-
-
- /* This is the path to the "Icon" program which is used for checking
- ** for ImageDrawers.
- */
- IconProgram = "Icon"
-
-
-
- /* ========== PLEASE DO NOT CHANGE ANYTHING BELOW THIS LINE ========== */
-
- Signal ON SYNTAX
- Signal ON BREAK_C
-
- Options RESULTS
- Options FAILAT 21
-
- LF = "0a"x
- ImageDrawer = "ImageDrawer, don't remove this entry"
- hutti_ist_eine_nase = "»»»» Icon by Martin Huttenloher ««««"
-
- Parse ARG DOpusPort function source dummy dest .
-
- Address VALUE DOpusPort
-
- If (function = "init") Then
- Call init
- Else If (function = "IconUpdate") Then
- Call IconUpdate(source, dest)
- Else If (function = "AddImageDrawer") Then
- Call AddImageDrawer(source)
- Else If (function = "RemImageDrawer") Then
- Call RemImageDrawer(source)
- Else If (function = "XENCopyright") Then
- Call XENCopyright(source)
- Call Quit
-
-
- init: Procedure
- DOpus Command '"IconUpdate" Program "IconUpdate" Desc "Updates icons'' information"'
- DOpus Command '"AddImageDrawer" Program "IconUpdate" Desc "Converts drawers to ImageDrawers"'
- DOpus Command '"RemImageDrawer" Program "IconUpdate" Desc "Converts ImageDrawers to drawers"'
- DOpus Command '"XENCopyright" Program "IconUpdate" Desc "Adds XEN''s copyright to icons"'
- Return
-
-
- IconUpdate: Procedure EXPOSE LF ImageDrawer IconProgram IconUpdateProgram
- Parse ARG source , dest
- Lister Query source NumSelEntries
- If (RESULT < 1) Then
- Return
- Lister Query dest NumSelEntries
- entries = RESULT
- If (entries < 1) Then
- Return
- Lister Set source Busy 1
- Lister Set dest Busy 1
- Lister Query source Path
- sourcepath = Strip(RESULT, "B", '"')
- Lister Query dest Path
- destpath = Strip(RESULT, "B", '"')
- Lister Query source FirstSel
- icon = sourcepath || Strip(RESULT, "B", '"')
- selcount = 0
- Do dummy = 1 To entries
- Lister Query dest FirstSel
- file = Strip(RESULT, "B", '"')
- Lister Query dest Entry '"' || file || '"'
- If (SubStr(RESULT, Length(file) + 2, 1) ~= "-") Then
- Do
- doit = TRUE
- If (CheckForImageDrawers = TRUE) Then
- Do
- Address COMMAND IconProgram || ' "' || destpath || file || '" "' || ImageDrawer || '" FIND'
- If (RC = 0) Then
- Do
- DOpus Request '"The file' || LF || destpath || file || LF || 'seems to be an ImageDrawer.' || LF || 'Replace the image anyway?" Yes|No'
- If (RC = 0) Then
- doit = FALSE
- End
- End
- If (doit = TRUE) Then
- Do
- Address COMMAND IconUpdateProgram || ' "' || icon || '" "' || destpath || file || '"'
- reread = TRUE
- End
- End
- Else
- Do
- selentries.selcount = file
- selcount = selcount + 1
- End
- Lister Select dest '"' || file || '"' 0
- Lister Refresh dest
- End
- Do dummy = 0 To (selcount - 1)
- Lister Select dest '"' || selentries.dummy || '"' 1
- End
- Lister Set source Busy 0
- Lister Set dest Busy 0
- Lister Query source FirstSel
- Lister Select source RESULT 0
- Lister Refresh source
- If (reread = TRUE) Then
- Lister Read dest '"' || destpath || '"'
- Return
-
-
- AddImageDrawer: Procedure EXPOSE LF ImageDrawer IconProgram
- Parse ARG dest
- Lister Query dest NumSelEntries
- entries = RESULT
- if (entries < 1) Then
- Return
- Lister Set dest Busy 1
- Lister Query dest Path
- destpath = Strip(RESULT, "B", '"')
- selcount = 0
- Do dummy = 1 To entries
- Lister Query dest FirstSel
- file = Strip(RESULT, "B", '"')
- Lister Query dest Entry '"' || file '"'
- If (SubStr(RESULT, Length(file) + 2, 1) ~= "-") Then
- Do
- Address COMMAND IconProgram || ' "' || destpath || file || '" "' || ImageDrawer || '" FIND'
- If (RC ~= 0) Then
- Do
- Address COMMAND IconProgram || ' "' || destpath || file || '" "' || ImageDrawer || '" ADD'
- reread = TRUE
- End
- End
- Else
- Do
- selentries.selcount = file
- selcount = selcount + 1
- End
- Lister Select dest '"' || file || '"' 0
- Lister Refresh dest
- End
- Do dummy = 0 To (selcount - 1)
- Lister Select dest '"' || selentries.dummy || '"' 1
- End
- Lister Set dest Busy 0
- If (reread = TRUE) Then
- Lister Read dest '"' || destpath || '"'
- Return
-
-
- RemImageDrawer: Procedure EXPOSE ImageDrawer IconProgram
- Parse ARG dest
- Lister Query dest NumSelEntries
- entries = RESULT
- if (entries < 1) Then
- Return
- Lister Set dest Busy 1
- Lister Query dest Path
- destpath = Strip(RESULT, "B", '"')
- selcount = 0
- Do dummy = 1 To entries
- Lister Query dest FirstSel
- file = Strip(RESULT, "B", '"')
- Lister Query dest Entry '"' || file '"'
- If (SubStr(RESULT, Length(file) + 2, 1) ~= "-") Then
- Do
- Address COMMAND IconProgram || ' "' || destpath || file || '" "' || ImageDrawer || '" FIND'
- If (RC = 0) Then
- Do
- Address COMMAND IconProgram || ' "' || destpath || file || '" "' || ImageDrawer || '" REMOVE'
- reread = TRUE
- End
- End
- Else
- Do
- selentries.selcount = file
- selcount = selcount + 1
- End
- Lister Select dest '"' || file || '"' 0
- Lister Refresh dest
- End
- Do dummy = 0 To (selcount - 1)
- Lister Select dest '"' || selentries.dummy || '"' 1
- End
- Lister Set dest Busy 0
- If (reread = TRUE) Then
- Lister Read dest '"' || destpath || '"'
- Return
-
-
- XENCopyright: Procedure EXPOSE IconProgram hutti_ist_eine_nase
- Parse ARG dest
- Lister Query dest NumSelEntries
- entries = RESULT
- if (entries < 1) Then
- Return
- Lister Set dest Busy 1
- Lister Query dest Path
- destpath = Strip(RESULT, "B", '"')
- selcount = 0
- Do dummy = 1 To entries
- Lister Query dest FirstSel
- file = Strip(RESULT, "B", '"')
- Lister Query dest Entry '"' || file '"'
- If (SubStr(RESULT, Length(file) + 2, 1) ~= "-") Then
- Do
- Address COMMAND IconProgram || ' "' || destpath || file || '" "' || hutti_ist_eine_nase || '" FIND'
- If (RC ~= 0) Then
- Do
- Address COMMAND IconProgram || ' "' || destpath || file || '" "' || hutti_ist_eine_nase || '" ADD'
- reread = TRUE
- End
- End
- Else
- Do
- selentries.selcount = file
- selcount = selcount + 1
- End
- Lister Select dest '"' || file || '"' 0
- Lister Refresh dest
- End
- Do dummy = 0 To (selcount - 1)
- Lister Select dest '"' || selentries.dummy || '"' 1
- End
- Lister Set dest Busy 0
- If (reread = TRUE) Then
- Lister Read dest '"' || destpath || '"'
- Return
-
-
- SYNTAX:
- BREAK_C:
- Address VALUE DOpusPort
- DOpus Request '"Error in ARexx script' || LF || 'IconUpdate.dopus5,' || LF || 'Line ' || SIGL || ':' || LF || LF || ErrorText(RC) || '"'
- Call Quit
-
-
- Quit:
- Exit
-
-